<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // var ar = [10,20,30,40];
        // for ( var i = 0 ; i <= ar.length ; i ++ ) {
        //     console.log(ar[i]);
        // }
        // console.log(ar);
        // var arr = new Array;
        // // arr[0][2] = 8 ;
        // // console.log(arr);
        // function func (){
        //     console.log(111);
        // }
        // console.log(typeof func);
        
        var arr2 = [10,20,30,40,50]; 
        function arrPlus (arr){
            var res = 0 ;
            for ( var i = 0 ; i < arr.length ; i ++ ) {
                res = res + arr[i] ;
            }
            console.log(res) ;
        }
        arrPlus(arr2);
    </script>
</body>
</html>